﻿@model Classified.Domain.Entities.Page


<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
 <script src="@Url.Content("~/Content/ckeditor/ckeditor.js")" type="text/javascript"></script>
	<script type="text/javascript" src="@Url.Content("~/Content/ckfinder/ckfinder.js")"></script>

    <fieldset>
     
        @Html.HiddenFor(model => model.Id)
        @Html.HiddenFor(model => model.CreatedOnUtc)

        <div class="clearfix">
            @Html.LabelFor(model => model.Name)
        
         <div class="input midtext">
           @Html.EditorFor(model => model.Name)
           @Html.ValidationMessageFor(model => model.Name)
       </div>
       </div>

         <div class="clearfix">
            @Html.LabelFor(model => model.Title)
       
         <div class="input midtext">
             @Html.EditorFor(model => model.Title)
             @Html.ValidationMessageFor(model => model.Title)
         </div>
          </div>

       <div class="clearfix">
            @Html.LabelFor(model => model.Body)
        
        <div class="input">
           @Html.TextAreaFor(model => model.Body)
           @Html.ValidationMessageFor(model => model.Body)
       </div>
       </div>

       <div class="clearfix">
            @Html.LabelFor(model => model.MetaTitle)
        
        <div class="input">
           @Html.EditorFor(model => model.MetaTitle)
           @Html.ValidationMessageFor(model => model.MetaTitle)
       </div>
       </div>

         <div class="clearfix">
            @Html.LabelFor(model => model.MetaKeywords)
       
        <div class="input">
            @Html.EditorFor(model => model.MetaKeywords)
            @Html.ValidationMessageFor(model => model.MetaKeywords)
        </div>
       </div>

         <div class="clearfix">
            @Html.LabelFor(model => model.MetaDescription)
        <div class="input">
            @Html.EditorFor(model => model.MetaDescription)
            @Html.ValidationMessageFor(model => model.MetaDescription)
         </div>
       </div>

         <div class="clearfix">
            @Html.LabelFor(model => model.PageDesc)
        <div class="input">
            @Html.EditorFor(model => model.PageDesc)
            @Html.ValidationMessageFor(model => model.PageDesc)
           </div>
       </div>

        <div class="clearfix">
            @Html.LabelFor(model => model.IsActive)
        <div class="input">
            @Html.EditorFor(model => model.IsActive)
            @Html.ValidationMessageFor(model => model.IsActive)
        </div>
       </div>
        
        <div class="clearfix">
           Display in Footer
       <div class="input">
            @Html.EditorFor(model => model.IsDefault)
            @Html.ValidationMessageFor(model => model.IsDefault)
        </div>
       </div>

      <div class="actions">
            <input type="submit" class="btn primary" value="Save" />
            @if (Model!=null && Model.Id > 0)
            {   <text>
                @Html.ActionLink("Delete", "Delete", new { id = Model.Id }, new { @class = "btn" })
                </text>
            }
			@Html.ActionLink("Back to List", "Index", null, new { @class = "btn" })
        </div>
    </fieldset>

    <script type="text/javascript">
        $(document).ready(function() {
            // This is a check for the CKEditor class. If not defined, the paths must be checked.
            if (typeof CKEDITOR == 'undefined') {
                document.write(
                    '<strong><span style="color: #ff0000">Error</span>: CKEditor not found</strong>.' +
                        'This sample assumes that CKEditor (not included with CKFinder) is installed in' +
                            'the "/ckeditor/" path. If you have it installed in a different place, just edit' +
                                'this file, changing the wrong paths in the &lt;head&gt; (line 5) and the "BasePath"' +
                                    'value (line 32).');
            } else {
                var editor = CKEDITOR.replace('Body');
               // editor.setData('');

                // Just call CKFinder.setupCKEditor and pass the CKEditor instance as the first argument.
                // The second parameter (optional), is the path for the CKFinder installation (default = "/ckfinder/").
                CKFinder.setupCKEditor(editor, '/Content/ckfinder');
                // It is also possible to pass an object with selected CKFinder properties as a second argument.
                // CKFinder.setupCKEditor( editor, { basePath : '../', skin : 'v1' } ) ;
            }
        });
</script>